﻿
using HotSwap.Core;
using Libs;

Run();

var assemblys =  AppDomain.CurrentDomain.GetAssemblies();

Console.Read();

void Run()
{
    var domain = DomainManage.CreateDomain();
    var assembly = domain.LoadFromAssemblyPath(@"D:\HotSwap\HotSwap\test\Test.HotSwap.Core\bin\Debug\net6.0\Test.HotSwap.Core.dll");
    var data = assembly.GetTypes().FirstOrDefault(x => typeof(IHotSwapCore).IsAssignableFrom(x));
    var core = assembly.CreateInstance(data.FullName) as IHotSwapCore; 

    core.Start();
    domain.Unload();
}




